function calculatedDefault(data, type) {
    //获取数据库中的历史生效成本
    var oldList = [];
    //先获取itemNBR
    var itemNbr = data.ITEM_NBR;
    var size = data.VNPK_QTY;
    var rate = data.TAX_RATE;
    var itemList = [];
    if (type === 'cost') {
        if (typeof data.JSON_CASECOST_LIST == "string") {
            oldList = JSON.parse(data.JSON_CASECOST_LIST);
        } else {
            oldList = data.JSON_CASECOST_LIST;
        }

    } else if (type === 'retail') {
        if (typeof data.JSON_CASECOST_LIST == "string") {
            oldList = JSON.parse(data.JSON_RETAIL_LIST);
        } else {
            oldList = data.JSON_RETAIL_LIST;
        }
    }
    var now3 = new Date();
    if (isNotEmpty(oldList)) {
        for (var i = 0; i < oldList.length; i++) {
            var old = oldList[i];
            var effDate = oldList[i].EFFECTIVE_DATE;
            var expDate = oldList[i].EXPIRATION_DATE;
            var cost = oldList[i].VNPK_PPD_COST_AMT;
            var itemNbrList;
            // if (Date.parse(effDate)>now3){
            if (type === 'cost') {
                itemNbrList = {
                    itemNbrT: itemNbr,
                    effDate: effDate,
                    expDate: expDate,
                    cost: cost,
                    size: size,
                    rate: rate,
                    priceType: old.PRICE_TYPE,
                    type: 'old',
                    pricingActionId: old.PRICING_ACTION_ID,
                };
                itemList.push(itemNbrList);
            } else if (type === 'retail') {
                if (old.PRICE_TYPE === 'AR' || old.PRICE_TYPE === 'TR' || old.PRICE_TYPE === 'BP') {
                    itemNbrList = {
                        itemNbrT: itemNbr,
                        effDate: effDate,
                        expDate: expDate,
                        priceType: old.PRICE_TYPE,
                        type: 'old',
                        priceTrait: old.PRICE_TRAIT,
                        retail: old.CUST_BASE_RTL_AMT,
                        size: size,
                        rate: rate,
                        comment: '',
                        pricingActionId: old.PRICING_ACTION_ID,
                    };
                    itemList.push(itemNbrList);
                }
            }
            // }



            // itemList.push(itemNbrList);
        }
    }


    return itemList;
}
